import {React,lazy,Suspense} from 'react'
import { HashRouter,Routes,Route ,Navigate } from 'react-router-dom'
import Category from '../pages/category/category.jsx'
import Homeview from '../pages/homeview/homeview.jsx'
import Register from '../pages/register/register.jsx'
import Shopcar from '../pages/shopcar/shopcar.jsx'
// import Life from '../pages/view/life.jsx'
// import Login from '../pages/view/login.jsx'
// import Category from '../pages/category.jsx'
// import Home from '../pages/home.jsx'
// import Index from '../pages/index.jsx'

const Index = lazy(()=>import('../pages/index/index.jsx'))
const Login = lazy(()=>import('../pages/login/login.jsx'))
// const Home = lazy(()=>import('../pages/view/home.jsx'))
// const Category = lazy(()=>import('../pages/view/category.jsx'))
// const IndexSwiper = lazy(()=>import('../pages/view/IndexSwiper.jsx'))
// const Life = lazy(()=>import('../pages/view/life.jsx'))

const  BasicRoute = ()=>{
    return (
            <HashRouter>
                <Suspense fallback={''}>
                    <Routes>
                            <Route path='/' element={<Navigate to='/homeview'></Navigate>}></Route>
                            <Route path='/' element={<Index/>}>
                                <Route path='/homeview' element={<Homeview/>}></Route>
                                <Route path='/category' element={<Category/>}></Route>
                                <Route path='/shopcar' element={<Shopcar/>}></Route>
                                
                            </Route>
                            <Route path='/login' element={<Login/>}/>
                            <Route path='/register' element={<Register/>}/>
                            

                            {/* 
                            <Route path='/category' element={<Category/>}></Route>
                            <Route path='/login' element={<Login/>}/>
                            <Route path='/indexswiper' element={<IndexSwiper/>}/>
                            <Route path='/life' element={<Life/>}/> */}
                    </Routes>
                </Suspense>
            </HashRouter>
    )
        }
export default BasicRoute